#ifndef CREATEDEVICECL_H
#define CREATEDEVICECL_H

#include <QFrame>
#include <QtCL/qcldevice.h>

namespace Ui {
    class CreateDeviceCL;
}

class QCLContext;

class CreateDeviceCL : public QFrame
{
    Q_OBJECT

public:
    explicit CreateDeviceCL(QWidget *parent = 0);
    ~CreateDeviceCL();

    void closeEvent(QCloseEvent *e);

    //bool createContext(QCLContext & context);
    const QList<QCLDevice> &getDevices() const { return m_devices; }
    int getSelectedContextIdx() const;
    QCLContext & getSelectedContext() const;
    static QCLContext & getContext(int idx);
    static int createContext(int idx, const QList<QCLDevice> & devs);

public slots:
    void fillPlatforms();
    void fillDevices();
    void fillDescription();
    void fillContexts();
    void selectedContextChanged();
    void captureContext();

signals:
    void selectedValidDevices(bool);
    void selectedValidContext(int);

private:
    Ui::CreateDeviceCL *ui;
    QList<QCLDevice> m_devices;
};

#endif // CREATEDEVICECL_H
